<template>
  <div class="home">
    <van-nav-bar
      title="影院系统"
      left-text="返回"
      right-text="按钮"
      left-arrow
      fixed
      @click-left="onClickLeft"
      @click-right="toSettings"
    >
      <template #right>
        <van-icon name="setting-o" size="18" />
      </template>
    </van-nav-bar>
    <van-tabbar v-model="active">
      <!-- <van-tabbar> -->
      <van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
      <van-tabbar-item icon="orders-o" to="/order">订单</van-tabbar-item>
      <van-tabbar-item icon="user-circle-o" to="/user">我的</van-tabbar-item>
    </van-tabbar>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data: () => ({
    active: 0,
  }),
  methods: {
    onClickLeft() {
      // 返回上一个页面
      this.$router.go(-1);
    },
    toSettings() { // 去设置页面
      this.$router.push('/settings');
    }
  },
};
</script>

<style scoped>
.home {
  padding-top: 46px;
  padding-bottom: 50px;
}
</style>